//
//  RootNavigationBar.m
//  QianBao
//
//  Created by whj on 16/3/3.
//  Copyright © 2016年 wudeliang. All rights reserved.
//

#import "RootNavigationBar.h"

@implementation RootNavigationBar

#define NAVIGATION_BTN_MARGIN 0
#define RightMargin 5

- (void)layoutSubviews {
    
    [super layoutSubviews];
    
    UINavigationItem *navigationItem = [self topItem];
    
    UIView *leftsubview = [[navigationItem leftBarButtonItem] customView];
    
//    UIView *rightsubview = [[navigationItem rightBarButtonItem] customView];
    
    if (leftsubview) {
        
        CGRect subviewFrame = leftsubview.frame;
        subviewFrame.origin.x = NAVIGATION_BTN_MARGIN;
        subviewFrame.origin.y = (self.frame.size.height - leftsubview.frame.size.height) / 2;
        
        [leftsubview setFrame:subviewFrame];
    }
//    
//    if (rightsubview) {
//        
//        CGRect subviewFrame = rightsubview.frame;
//        NSLog(@"subViewRight = %@",NSStringFromCGRect(subviewFrame));
//        subviewFrame.origin.x = Screen_Width - subviewFrame.size.width - RightMargin;
//        subviewFrame.origin.y = (self.frame.size.height - rightsubview.frame.size.height) / 2;
//        
//        [rightsubview setFrame:subviewFrame];
//    }
    
    
}

@end
